package com.java123.t8.demo;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

import com.java123.t8.demo.entity.Student;

public class SetDemo {
	
	public static void main(String[] args) {
		Student stu = new Student();
		List<Student> stus = new ArrayList<Student>();
		// 4 增删改查 CURD
		stus.add(stu);
		stus.set(0, stu);
		System.out.println(stus.toString());
		stus.get(0);
		stus.remove(0);
		stus.remove(stus);
		System.out.println(stus.toString());

		Map<String, Student> stuMap = new HashMap<String, Student>();
		stuMap.put("key1", stu);
		stuMap.put("key1", stu);
		stuMap.get("key1");
		stuMap.remove("key1");
		Set<String> keys = stuMap.keySet();
		for (String key : keys) {
			System.out.println(stuMap.get(key));
		}
		
	}
}
